
import { getHomeListApi, getCollectListApi, getDetailListApi } from "@/api/index.js"
let actions = {
    async actChangeHomeListDatas(context) {
        let result = await getHomeListApi()
        //console.log(result.data);
        // context.commit("mutations中定义的方法", ajax请求出来的数据)
        context.commit("changeHomeListDatas", result.data)
    },
    async actChanegCollectListDatas(context) {
        let result = await getCollectListApi()
        console.log(result.data);
        // context.commit("mutations中定义的方法", ajax请求出来的数据)
        context.commit("chanegCollectListDatas", result.data)
    },
    async actChanegDetailListDatas(context, id) {
        let result = await getDetailListApi(id)
        console.log(result.data);
        // context.commit("mutations中定义的方法", ajax请求出来的数据)
        context.commit("chanegDetailListDatas", result.data)
    }
}

export default actions